<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>菜鸟教程(runoob.com)</title> 
</head>
<body>
	
<h1>我的第一段 JavaScript</h1>
<p id="demo">
JavaScript 能改变 HTML 元素的样式。
</p>
<script>

function changeColor(){
	x=document.getElementById("demo") 
	x.innerHTML='666';
	if(x.style.color.match("#ff0000")){
		x.style.color="#ff00ff";
	}
	else{
		x.style.color="#ff0000";
	}
}
</script>
<button type="button" onclick="changeColor()">点击这里</button>
	
</body>
</html>
